package com.hougong.im.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.hougong.im.entity.ApplyAddfriend;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 申请好友表 Mapper 接口
 * </p>
 *
 * @author lsz
 * @since 2018-08-25
 */

public interface ApplyAddfriendMapper extends BaseMapper<ApplyAddfriend> {

    List<ApplyAddfriend> selectWithFromAndStatus(@Param("fromUid") Long fromUid, @Param("status")int status);

    List<ApplyAddfriend> selectWithFromAndToAndStatus(@Param("fromUid")Long fromUid,@Param("toUid")Long toUid,@Param("status")int status);

    List<ApplyAddfriend> selectWithToAndStatus(@Param("toUid")Long toUid,@Param("status")int status);

    int  selectUnreadCount(@Param("myUid")Long myUid);

    List<ApplyAddfriend> selectAboutMe(@Param("fromUid")Long fromUid);


    //设置别人加我为已读
    void updateAddMeHasRead(@Param("currentUid")Long currentUid);
    //设置别人拒绝或者接受我为已读
    void updateOtherRejectOrAcceptHasRead(@Param("currentUid")Long currentUid);
}
